import json
from apiAutoTestingFramwork.config  import BASE_DIR

# 读取json数据
def read_json_data():
    #api测试框架不在根目录下，如果用相对路径”../data/ihrm_login.json“进行参数化
    # @parameterized.expand(read_json_data())时无法找到该文件
    # 会报错：FileNotFoundError: [Errno 2] No such file or directory:
    with open(BASE_DIR+"/data/ihrm_login.json", "r", encoding="utf-8") as f:
        jsonData = json.load(f)
        re = []
        for item in jsonData:
            re.append(tuple(item.values()))
    return re


if __name__ == '__main__':
    print(read_json_data())